<?php

/**
 * @name: HOTN AnimeList
 * @author: HammerOnTheNail
 * @link: http://code.google.com/p/hotnanimelist/
 */

$eplug_admin = TRUE;
include("../../../../class2.php"); 
//include(e_ADMIN."auth.php");
include(e_PLUGIN."hotn_animelist/Class/animelist_mysql.php");
include(e_PLUGIN."hotn_animelist/Class/animelist_options.php");

// Admin jog vizsgálata
if(!getperms("P"))
{ 
	header("location:".e_BASE."index.php"); 
}

// beállítások mentése
if ($_POST['action'] == "edit")
{
	$sql->db_Delete("hotn_animelist_options");
	foreach ($_POST as $name => $value)
	{
		if ($name <> "action" && $name <> "options_submit")
		{
			$instert = array(
				"hotn_animelist_options_name" => $name,
				"hotn_animelist_options_value" => $value
			);
			$sql->db_Insert("hotn_animelist_options",$instert);
		}
	}
}

// Visza irányítás és állapot továbbítása
header("Location: ".e_PLUGIN."hotn_animelist/Admin/admin_index.php?options.edit.save");
?>